package com.cheng.rebuildproject.controller;

import com.cheng.rebuildproject.mapper.UserMapper;
import com.cheng.rebuildproject.pojo.ResponseResult;
import com.cheng.rebuildproject.pojo.User;
import com.cheng.rebuildproject.server.UserServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户相关操作类
 */
@RestController
@RequestMapping("/user")
public class LoginController {

    @Autowired
    private UserServer userServer;

    @PostMapping(value = "/login")
    public ResponseResult login(@RequestBody User user){
        //登录

        //调用server层
       return userServer.login(user);
    }
}
